<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Package Documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '#',
        VERSION:     '1.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="None" href="index.html" />
    <link rel="next" title="Runtime Documentation" href="runtime.html" />
    <link rel="prev" title="Datastore Documentation" href="datastore.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="runtime.html" title="Runtime Documentation"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="datastore.html" title="Datastore Documentation"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Index</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="package-documentation">
<h1>Package Documentation</h1>
<p>This page contains the Package Package documentation.</p>
<div class="section" id="module-package.build">
<h2>The <tt class="xref docutils literal"><span class="pre">build</span></tt> Module</h2>
<p>Created on 29/07/2009</p>
<p>&#64;author: Edward Huynh, Tony Allan</p>
<p>Build a package and upload it to google code.</p>
<dl class="function">
<dt id="package.build.create_resource_from_file">
<tt class="descclassname">package.build.</tt><tt class="descname">create_resource_from_file</tt><big>(</big><em>file_name</em>, <em>content</em>, <em>package_name</em>, <em>modules_in_package</em><big>)</big></dt>
<dd></dd></dl>

<dl class="function">
<dt id="package.build.get_modules">
<tt class="descclassname">package.build.</tt><tt class="descname">get_modules</tt><big>(</big><em>manifest</em><big>)</big></dt>
<dd>Passed a Manifest Resource object.
Returns a dictionary of all the modules that are in the manifest, 
with a value of True if its a startup module.</dd></dl>

</div>
<div class="section" id="module-package.googlecode_upload">
<h2>The <tt class="xref docutils literal"><span class="pre">googlecode_upload</span></tt> Module</h2>
<p>Google Code file uploader script.</p>
<dl class="function">
<dt id="package.googlecode_upload.encode_upload_request">
<tt class="descclassname">package.googlecode_upload.</tt><tt class="descname">encode_upload_request</tt><big>(</big><em>fields</em>, <em>file_path</em><big>)</big></dt>
<dd><p>Encode the given fields and file into a multipart form body.</p>
<p>fields is a sequence of (name, value) pairs. file is the path of
the file to upload. The file will be uploaded to Google Code with
the same file name.</p>
<p>Returns: (content_type, body) ready for httplib.HTTP instance</p>
</dd></dl>

<dl class="function">
<dt id="package.googlecode_upload.main">
<tt class="descclassname">package.googlecode_upload.</tt><tt class="descname">main</tt><big>(</big><big>)</big></dt>
<dd></dd></dl>

<dl class="function">
<dt id="package.googlecode_upload.upload">
<tt class="descclassname">package.googlecode_upload.</tt><tt class="descname">upload</tt><big>(</big><em>file</em>, <em>project_name</em>, <em>user_name</em>, <em>password</em>, <em>summary</em>, <em>labels=None</em><big>)</big></dt>
<dd><p>Upload a file to a Google Code project&#8217;s file server.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">file: The local path to the file.
project_name: The name of your project on Google Code.
user_name: Your Google account name.
password: The googlecode.com password for your account.</p>
<blockquote>
Note that this is NOT your global Google Account password!</blockquote>
<p class="last">summary: A small description for the file.
labels: an optional list of label strings with which to tag the file.</p>
</dd>
<dt>Returns: a tuple:</dt>
<dd><dl class="first docutils">
<dt>http_status: 201 if the upload succeeded, something else if an</dt>
<dd>error occured.</dd>
</dl>
<p>http_reason: The human-readable string associated with http_status
file_url: If the upload succeeded, the URL of the file on Google</p>
<blockquote class="last">
Code, None otherwise.</blockquote>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="package.googlecode_upload.upload_find_auth">
<tt class="descclassname">package.googlecode_upload.</tt><tt class="descname">upload_find_auth</tt><big>(</big><em>file_path</em>, <em>project_name</em>, <em>summary</em>, <em>labels=None</em>, <em>user_name=None</em>, <em>password=None</em>, <em>tries=3</em><big>)</big></dt>
<dd><p>Find credentials and upload a file to a Google Code project&#8217;s file server.</p>
<p>file_path, project_name, summary, and labels are passed as-is to upload.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>file_path: The local path to the file.
project_name: The name of your project on Google Code.
summary: A small description for the file.
labels: an optional list of label strings with which to tag the file.
config_dir: Path to Subversion configuration directory, &#8216;none&#8217;, or None.
user_name: Your Google account name.
tries: How many attempts to make.</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-package.manager">
<h2>The <tt class="xref docutils literal"><span class="pre">manager</span></tt> Module</h2>
<p>Created on 10/08/2009</p>
<p>&#64;author: eh01</p>
<dl class="exception">
<dt id="package.manager.BadYarraPackageException">
<em class="property">exception </em><tt class="descclassname">package.manager.</tt><tt class="descname">BadYarraPackageException</tt></dt>
<dd>Bases: <tt class="xref docutils literal"><span class="pre">exceptions.Exception</span></tt></dd></dl>

<dl class="class">
<dt id="package.manager.PackageManager">
<em class="property">class </em><tt class="descclassname">package.manager.</tt><tt class="descname">PackageManager</tt></dt>
<dd><p>Bases: <tt class="xref docutils literal"><span class="pre">object</span></tt></p>
<dl class="method">
<dt id="package.manager.PackageManager.download_file">
<tt class="descname">download_file</tt><big>(</big><em>url</em><big>)</big></dt>
<dd>returns the file located at the url provided</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.get_distribution">
<tt class="descname">get_distribution</tt><big>(</big><em>file_repository_location</em>, <em>distribution_name</em>, <em>specific_packages=None</em><big>)</big></dt>
<dd>returns the packages in the distribution specified by the distribution_name and file_repository_location.
Optionally the specific_packages is a list to filter the packages to return from the distribution</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.get_package">
<tt class="descname">get_package</tt><big>(</big><em>package_url=None</em>, <em>package_binary_contents=None</em><big>)</big></dt>
<dd>returns the contents of the package as a Package.
Parameters:
package_url &#8211; String: representation of a url.
package_binary_contents &#8211; String: binary contents</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.get_resource_from_zip">
<tt class="descname">get_resource_from_zip</tt><big>(</big><em>zip</em>, <em>resource_name</em>, <em>encoded</em><big>)</big></dt>
<dd>If encoed=True, base64 decode res.content and return the resource, or
if encoded=False, assume it&#8217;s a serialised resource.</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.install_distribution">
<tt class="descname">install_distribution</tt><big>(</big><em>ds</em>, <em>file_repository_location</em>, <em>distribution_name</em><big>)</big></dt>
<dd>installs the distribution named distribution_name at the distribution repository location specified by 
file_repository_location. file_repository_location and distribution name are both strings.</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.install_package">
<tt class="descname">install_package</tt><big>(</big><em>package</em>, <em>ds</em>, <em>installing_distribution</em><big>)</big></dt>
<dd>Installs a package resource. Installing a package is just adding the package&#8217;s resources to the 
datastore. Previous resources from the package are removed. First time installs 
(i.e. Installing the distribution), this method will not have access to a spaces_context, so there
is no need to check if there are existing versions of the package, as the first time install will be
a fresh install with NO packages already installed in the datastore. When updating individual packages,
we will have access to the spaces_context, as the runtime will already be installed. Hence we can check
for existing versions of the package and delete those resouces.
Parameters:
package &#8211; package.pkge.Package: Package to be installed.
ds &#8211; datastore.database.Datastore: Datastore instance.
installing_distribution &#8211; boolean: Indicator if we are installing a distribution.</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.load_active_packages">
<tt class="descname">load_active_packages</tt><big>(</big><em>ds</em><big>)</big></dt>
<dd>loads the active modules</dd></dl>

<dl class="method">
<dt id="package.manager.PackageManager.update_package">
<tt class="descname">update_package</tt><big>(</big><em>package_resource</em>, <em>ds</em><big>)</big></dt>
<dd>Update a package in the datastore.
Parameters:
package_resource &#8211; datastore.resource.Resource: Package resource.
ds &#8211; datastore.database.Datastore: DataStore instance.</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="package.manager.XMLFormatException">
<em class="property">exception </em><tt class="descclassname">package.manager.</tt><tt class="descname">XMLFormatException</tt></dt>
<dd>Bases: <tt class="xref docutils literal"><span class="pre">exceptions.Exception</span></tt></dd></dl>

</div>
<div class="section" id="module-package.pkge">
<h2>The <tt class="xref docutils literal"><span class="pre">pkge</span></tt> Module</h2>
<p>Created on 10/08/2009</p>
<p>&#64;author: eh01</p>
<dl class="class">
<dt id="package.pkge.Package">
<em class="property">class </em><tt class="descclassname">package.pkge.</tt><tt class="descname">Package</tt></dt>
<dd><p>Bases: <tt class="xref docutils literal"><span class="pre">object</span></tt></p>
<p>classdocs</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#">Package Documentation</a><ul>
<li><a class="reference external" href="#module-package.build">The <tt class="docutils literal"><span class="pre">build</span></tt> Module</a></li>
<li><a class="reference external" href="#module-package.googlecode_upload">The <tt class="docutils literal"><span class="pre">googlecode_upload</span></tt> Module</a></li>
<li><a class="reference external" href="#module-package.manager">The <tt class="docutils literal"><span class="pre">manager</span></tt> Module</a></li>
<li><a class="reference external" href="#module-package.pkge">The <tt class="docutils literal"><span class="pre">pkge</span></tt> Module</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="datastore.html"
                                  title="previous chapter">Datastore Documentation</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="runtime.html"
                                  title="next chapter">Runtime Documentation</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/package.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="runtime.html" title="Runtime Documentation"
             >next</a> |</li>
        <li class="right" >
          <a href="datastore.html" title="Datastore Documentation"
             >previous</a> |</li>
        <li><a href="index.html">Index</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright .
      Last updated on Jan 15, 2010.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
    </div>
  </body>
</html>